package com.study.thread.顺序执行;

import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class 线程池_1 {
    static String str;
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        str = cin.next();
        final Thread MyThread1=new Thread(new Runnable(){
            @Override
            public void run() {
                str=str+"_"+"A";
            }
        });

        final Thread MyThread2=new Thread(new Runnable(){
            @Override
            public void run() {
                str=str+"_"+"B";
            }
        });
        final Thread MyThread3=new Thread(new Runnable(){
            @Override
            public void run() {
                str=str+"_"+"C";
                System.out.println(str);
            }
        });
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(MyThread1);
        executor.submit(MyThread2);
        executor.submit(MyThread3);
        executor.shutdown();
    }
}